import request from '@/utils/request'

// 告警查询
export function WarningQuery(data) {
    return request({
      url: '/alarmManage/queryForPage',
      method: 'get',
      params: data
    })
  }

  // 生产数据查询
export function ProductQuery(data) {
    return request({
      url: '/quality/queryProcessingDataForPage',
      method: 'get',
      params: data
    })
  }

  // 生产合格率查询
export function ProductQualifiedQuery(data) {
    return request({
      url: '/quality/queryProductQuality',
      method: 'get',
      params: data
    })
  }

  // 采集数据查询
export function CollectDataQuery(data) {
    return request({
      url: '/device/obtainTorqueAndPressure',
      method: 'get',
      params: data
    })
  }

  // 设备状态查询
export function EquipStatusQuery(data) {
    return request({
      url: '/device/fault/list',
      method: 'get',
      params: data
    })
  }

//   设备使用查询
export function EquipUseQuery(data) {
    return request({
      url: '/device/usage/list',
      method: 'get',
      params: data
    })
  }

//   设备能耗查询
export function EquipPowerQuery(data) {
    return request({
      url: '/energy/management/list',
      method: 'get',
      params: data
    })
  }
//   生产计划查询
export function PlanQuery(data) {
    return request({
      url: '/PlanQuery',
      method: 'post',
      params: data
    })
  }

  //   最新生产数据查询
  export function LatestProductQuery(data) {
      return request({
        url: '/device/actual/production/planning',
        method: 'get',
        params: data
      })
    }

    //   告警信息统计
  export function MalfunctionStaticsQuery(data) {
    return request({
      url: '/alarmManage/alarmStatistics',
      method: 'post',
      data
    })
  }

// 生产排行榜统计
  export function ProductRankQuery(data) {
    return request({
      url: '/device/getsTheTotalNumberOfProductionRecords',
      method: 'get',
      params: data
    })
  }

  // 首页大屏获取产品产量
export function getYeild(data) {
  return request({
      url: '/device/yield/acquisition',
      method: 'get',
      params: data
  })
}

//  处理不合格产品接口
export function handleProduct(data) {
  return request({
      url: '/quality/handleProductQuality',
      method: 'post',
      data
  })
}

// 过程加工数据导出
export function exportProcess(data) {
  return request({
      url: '/quality/exportProcessingData',
      method: 'get',
      params: data,
      responseType: 'blob'
  })
}

// 扭矩值  折线图展示
export function CollectDataQueryNew(data) {
  return request({
    url: '/device/getTorqueAndPressure',
    method: 'get',
    params: data
  })
}

// 设备状态查询
export function getDeviceStatus() {
  return request({
      url: '/screen/getDeviceStatus',
      method: 'get'
  })
}
